home *** CD-ROM | disk | FTP | other *** search
- This directory contains the Eclectus merge utilities
- Copyright (C) 1992-96 Eclectus (D. John Anderson, Alan B. Harper).
-
- Eclectus merge utilities are free software; you can redistribute
- them and/or modify them under the terms of the GNU General Public License
- as published by the Free Software Foundation; either version 1, or
- (at your option) any later version.
-
- Eclectus merge utilities are distributed in the hope that they
- will be useful, but WITHOUT ANY WARRANTY; without even the implied
- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- See the GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with the Eclectus merge utilities; see the file COPYING.
- If not, write to the Free Software Foundation, 675 Mass Ave, Cambridge,
- MA 02139, USA.
-
- This version was released on Wednesday, September 25, 1996.
-
- These 3 utilities--Merge, Difference, and Undifference--make it easy
- for many developers to work on the same code base.
-
- Start with a complete copy of your source code. This copy is called
- the base, which for this example we'll assume is in the directory
- tree named EC-0. We write-protect all the files in EC-0 and put it
- in a public place. Each developer makes a personal write-enabled
- copy of EC-0, named EC on their own machine. They make all their changes
- to their personal copy. When everyone agrees that their changes are
- ready to merge into a new base we use Merge to merge each
- derived copy into EC-0 and create a new base called EC-1, which
- everyone copies and development continues.
-
- This has an advantage over the traditional "check-in/check-out"
- approach in that more than on person can modify a file at the same time.
- I was introduced to this approach by Mike Demony who developed it at
- MIPS and later promoted it at NeXT. Our experience during the last
- 10 years convinced me that it is much more efficient that the traditional
- approach, especially in the early stages of development. It also has
- the advantage of using the file system for storing the files.
-
- There are two other programs, Difference and Undifference, that store
- only the changes between two source trees (e.g. EC-0 and EC-1). We
- use these programs to store successive versions in a more compact form.
- It can also be used to easily exchange versions across different platforms
- (e.g. Windows, Macintosh and NeXT). You may find them useful for bringing
- copies of your project home on a floppy or emailing your source to a
- co-worker who already has a copy of the base.
-
- These programs have been used extensively on Macintosh and Windows for many
- years.
-
- They currently run on Windows NT, Macintosh and NeXT. They are small
- which makes them easy to maintain and fast to execute. They can easily
- be ported to other environments.
-
- The distribution contains release executables, debugging executables, and
- source code for building the release executables.
-
- Release versions for Windows are:
- WinTools\Difference.exe
- WinTools\Merge.exe
- WinTools\Undifference.exe
-
- Debug versons are:
- WinTools\DifferenceDebug.exe
- WinTools\MergeDebug.exe
- WinTools\UndifferenceDebug.exe
-
- Release versions for Macintosh are:
- :MacTools:Difference.mpw
- :MacTools:Merge.mpw
- :MacTools:Undifference.mpw
-
- Debug versions are:
- :MacTools:DifferenceDebug.mpw
- :MacTools:MergeDebug.mpw
- :MacTools:UndifferenceDebug.mpw
-
- Note--we use the ".mpw" file extension on the MPW tools so that the difference
- tools on other platforms can recognize the tools as binary files. You can
- rename these files and remove the file extension when you copy the tools to your
- "Tools" or "User Commands" directory in your MPW folder.
-
- Recent versions of these tools can be found at
- ftp://ftp.dnai.com/users/aharper/EclectusMergeUtilities
-
- To compile the release versions on Microsoft Visual C++ 4.1
- open the project files
-
- WinDifference.mdp
- WinMerge.mdp
- WinUndifference.mdp
-
- and build. The release versions of the executables are created:
- DifferenceR.i/Difference
- MergeR.i/Merge
- UndifferenceR.i/Undifference
- The debugging versions won't build in this release because source code for
- heap debugging routines are not included. The debugging executables, are
- however, supplied.
-
- To compile the release versions under MPW as supplied on the CW10 Gold disk
- from Metrowerks execute first:
-
- make -f MacMerge.make clean
- make -f MacDifference.make clean
- make -f MacUndifference.make clean
-
- then execute:
-
- make -f MacMerge.make
- make -f MacDifference.make
- make -f MacUndifference.make
-
- Three files are created:
- :DifferenceR.i:Difference
- :MergeR.i:Merge
- :UndifferenceR.i:Undifference
-
- (Note--a standard install from the CW10 Tools disk does not place the interface files
- and libraries in the expected directories. You will need to copy the
- appropriate .h files to MWCIncludes and the appropriate libraries to MW68KLibraries
- and MWPPCLibraries. See the install instructions on the CW10 disk.)
-
- To compile under the Metrowerks CW10 integrated environment, use the projects
- in the "Metrowerks Folder" folder. To make 68K tools, open each of the projects
- Difference68K.mwk, Merge68K.mwk, and Undifference68K.mwk and bring them up to date.
- Rename the resulting tools by deleting the ".68K" extension. To make PowerPC native tools,
- open the "...PPC.mwk" files, bring them up to date, and delete the ".PPC" extension
- from the names of the resulting tools. To make fat tools, first make the 68K tools,
- but don't rename them. Then bring the "...FAT.mwk" files up to date. Note, only MPW
- Shell 3.4d1 and later or ToolServer 3.4d1 or later will use the PowerPC code in a
- fat MPW tool. Older versions of MPW will execute the 68K code in emulation.
-
- To compile on Next:
-
- make -f NextMerge.make clean
- make -f NextMerge.make
- make -f NextDifference.make clean
- make -f NextDifference.make
- make -f NextUndifference.make clean
- make -f NextUndifference.make
-
- 3 files are created:
- DerivedDifference.i/Difference
- DerivedUndifference.i/Undifference
- DerivedMerge.i/Merge
-
- usage: Difference SourcePath DestinationPath >DifferenceScriptFile
-
- Produces on stdout a file that stores the changes in the files in the tree DestinationPath
- that are not in SourcePath. This is useful for backups, storing smaller copies of modified
- file trees and beaming changes in file trees through a slow wire. Note: on Macintosh
- the SourcePath and DestinationPath must either be fully qualified paths (starting with
- the name of a disk), or must start with a ":".
-
- Any file or directory name (except those listed on the command line) beginning with "." is
- ignored. In addition there is a list of extensions for files and directories that are ignored.
- They currently include:
-
- i, idb, ilk, ncb, obj, pch, pdb, and tmp
-
- Like the binary names extensions below this list can easily be updated by modifying
- ignoreExtensions near the top of io.c
-
- Binary files are stored in ASCII (hexidecimal) and are not stored as differences, i.e.
- they take as much space as the hexidecimal representation of the file. Binary files
- are those that don't have a 'TEXT' type on Macintosh or have one of the following
- extensions on other machines:
-
- aps, bmp, bsc, dll, exe, hlp, ico, ink, lib, mdp, mpw, mwk, ncb, obj, os, osx, pch,
- pdb, prj, res, sbr, scr, vcp, wri, 8bf
-
- You can easily change this list by modifying binaryExtensions near the top of io.c. Sometimes
- the code gets edited and someone forgets to update this README file with a file extension, so
- if you might want to double check the code.
-
- If your difference files get large because of many binary files you can compress them to
- achieve considerable savings of space; we often get 80% compression using StuffIt.
-
- usage: Undifference SourcePath DifferenceScriptFile DestinationPath
-
- Recreates DestinationPath out of DifferenceScriptFile and SourcePath.
-
- You can think of Difference and Undifference the same way you think of a compression
- program. Both programs are designed to work on text files that are line oriented (e.g.
- changes are stored as a set of line oriented editing changes). They also work on
- binary files, but they don't save any space since the files are stored in ASCII. A
- 32 bit hash calculated when Undifference reconstructs a tree ensures that the result is
- correct. If a file is unchanged by the difference script when it is Undifferenced,
- the data is set to the original date. Execute permission is set if the source file
- has execute permission. This is useful for scripts. On Macintosh the resource fork
- is taken from the file in the SourcePath if one exists.
-
- Difference and Undifference can also be used to transfer entire directory trees from
- one platform to another. To do this, difference the tree against an empty directory.
- This creates a text file which you can transfer to another platform. Change the end-of-line
- character to match the character expected by that platform and then undifference
- against an empty directory. The resulting directory will have identical binary files
- as the source, and text files will be the same except for the end of line characters.
-
- usage: Merge [-c] basePath modification1Path [modification2Path] ... destinationPath
- -c shows all changes even if no collisions occur
-
- Merges all changes in the files contained in modification1Path, [modification2Path], ...
- that have been made to basePath into the new path destinationPath. Changes are
- automatically merged. If two or more people change the same lines a collision occurs
- and all changes are listed separately in the merged file. The merged file is renamed
- by prepending a "!" to the name so you can easily find files that contain collisions.
- If you choose the "-c" option all changes are listed as collisions, which may be useful
- if you want to review all the changes. Almost nobody uses the -c option.
-
- If binary files differ you must merge them by hand. When they differ they are
- listed as !1File, !2File, !3File, ... Each corresponds to the respective modification
- path on the command line. Files which occur in more than one derived path (and
- which differ) but do not occur in the base path are also listed as
- !1File, !2File, !3File, ... and need to be integrated by hand.
-
- The message "ADDED" indicates that a file has been added in one of the derived paths. The
- message "REMOVED" indicates that a file has been removed from one of the derived paths.
- This is useful to help find garbage files that sometimes don't get removed from a source tree
- before a merge.
-
- Files that are not modified during the merge have the same date as the original date.
- The resouce fork on Macintosh is taken from the copy in the basePath.
-
- Mac and Next have targets in their make files which include debug, install, test and testDebug.
- debug refers to files not included. These files were used to test the memory allocation
- to make sure there were no memory leaks, free blocks weren't used, only the contents
- of blocks were used, plus zillions of other constency checks. install is used for our
- purposes, you should install the tools by hand. test does some simple tests. testDebug does
- the same thing as test but with additional tests for the debug versions.
-
- On Windows rather than adding targets to the makefile, there is a batch script
- "WinMergeTest.bat" that does testing.
-
- On the Macintosh, the output from a successful "make -f macmerge.make test" is:
-
- COLLISION :MergeR.i:testfile.out
- File #1: :MergeR.i:!testfile.out
- File #2: testfile.merge
-
- *** Files match ***
- ADDED BINARY FILE :MergeR.i:testd.out:AllChars.OS
- REMOVED BINARY FILE :MergeR.i:testd.out:BinaryFile.OS
- COLLISION ADDED BINARY FILE :MergeR.i:testd.out:BinaryFile1.OS
- REMOVED BINARY FILE :MergeR.i:testd.out:BinaryFile3.OS
- ADDED :MergeR.i:testd.out:FileToAdd
- REMOVED :MergeR.i:testd.out:FileToRemove
- REMOVED BINARY FILE :MergeR.i:testd.out:FileToRemove.OS
- COLLISION :MergeR.i:testd.out:testa
- COLLISION :MergeR.i:testd.out:testb
- COLLISION :MergeR.i:testd.out:testc
- COLLISION :MergeR.i:testd.out:testd
- ADDED :MergeR.i:testd.out:testd3d0:testa
- ADDED :MergeR.i:testd.out:testd3d0:testb
- ADDED :MergeR.i:testd.out:testd3d0:testc
- ADDED :MergeR.i:testd.out:testd3d0:testd
- BINARY FILE :testd.mac.merge:!1BinaryFile1.OS
- BINARY FILE :testd.mac.merge:!2BinaryFile1.OS
- :testd.mac.merge:!testa
- :testd.mac.merge:!testb
- :testd.mac.merge:!testc
- :testd.mac.merge:!testd
- BINARY FILE :testd.mac.merge:AllChars.OS
- :testd.mac.merge:FileToAdd
- :testd.mac.merge:testd3d0:testa
- :testd.mac.merge:testd3d0:testb
- :testd.mac.merge:testd3d0:testc
- :testd.mac.merge:testd3d0:testd
- No difference between file(s).
-
- Limitations
-
- The utilities use the standard C library calls to manage files. These calls currently
- limit the length of a file path to 255 characters on Macintosh. This can cause problems
- if your project has deeply nested directories and long names.
-
- Report bugs to aharper@dnai.com or jander@c2.org
-
- The Eclectus merge utilities were written by D. John Anderson who is available at:
-
- jander@c2.org
-
- Eclectus Software
- 11 Embarcadero West, Suite 120
- Oakland, CA 94607
- 510-444-6605 or 415-747-9609
-
- The vast majority of code was derived with little or no modification
- from GNU diff. GNU diff was written by Mike Haertel, David Hayes,
- Richard Stallman, Len Tower and Paul Eggert. The basic algorithm is
- described in: "An O(ND) Difference Algorithm and its Variations",
- Eugene Myers, Algorithmica Vol. 1 No. 2, 1986, p 251
-